package com.rnkrsoft.suyan.config.server.ajax.authority.mock;

import com.rnkrsoft.reflection4j.extension.Extension;
import com.rnkrsoft.suyan.config.server.ajax.authority.AuthorityContext;
import com.rnkrsoft.suyan.config.server.ajax.authority.AuthorityExtractor;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.UUID;

@Extension("mock")
public class MockAuthorityExtractor implements AuthorityExtractor {
    @Override
    public AuthorityContext extract(HttpServletRequest request, HttpServletResponse response) {
        AuthorityContext ctx = new AuthorityContext();
        ctx.setProduct("demo1");
        ctx.setAction("userManager");
        ctx.setVersion("1.0.0");
        ctx.setToken(UUID.randomUUID().toString());
        ctx.setOperate("addUser");
        ctx.setUserId(2);
        ctx.setUserName("test1");
        ctx.setMobileNo("185000001112");
        return ctx;
    }
}
